﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.IO;

namespace desktop
{
    class Program
    {
        static void Main(string[] args)
        {
            var client = new TcpClient(AddressFamily.InterNetwork);

            client.Connect("127.0.0.1", 9090);

            byte[] buffer = File.ReadAllBytes(@"F:\ping.png");
            

            using (var stream = client.GetStream())
            {
                stream.Write(buffer, 0, buffer.Length);
            }

            Console.WriteLine("File sent.");

            Console.ReadLine();
        }
    }
}
